import os
import sys

n = int(input())
a = []
a = list(map(int, input().split()))
dic = {}
for i in range(n):
    dic[a[i]] = dic.get(a[i], 0) + 1
uniquenum = 0
doublenum = 0
for v in dic.values():
    if v == 1:
        uniquenum += 1
    elif v > 2:
        doublenum += v - 2
if uniquenum > doublenum:
    print((uniquenum+doublenum)//2)
else:
    print(doublenum)